package com.zy.openchat.core.model.wallet;

import android.os.Parcel;
import android.os.Parcelable;

public class WalletInfo implements Parcelable {
    //余额
    public float balance;
    //钱包地址
    public String address;
    //是否设置过支付密码
    public boolean hasPaymentPassword;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeFloat(this.balance);
        dest.writeString(this.address);
        dest.writeByte(this.hasPaymentPassword ? (byte) 1 : (byte) 0);
    }

    public WalletInfo() {
    }

    protected WalletInfo(Parcel in) {
        this.balance = in.readFloat();
        this.address = in.readString();
        this.hasPaymentPassword = in.readByte() != 0;
    }

    public static final Creator<WalletInfo> CREATOR = new Creator<WalletInfo>() {
        @Override
        public WalletInfo createFromParcel(Parcel source) {
            return new WalletInfo(source);
        }

        @Override
        public WalletInfo[] newArray(int size) {
            return new WalletInfo[size];
        }
    };
}
